package unit15.serialClone;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Employee extends SerialCloneable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2216552272325126459L;
	public static final int RECODE_SIZE=100;
	private String username;
	private int salary;
	private Date date;
	@Override
	public String toString() {
		return "Employee [username=" + username + ", salary=" + salary + ", date=" + date + "]";
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public int getSalary() {
		return salary;
	}
	public void setSalary(int salary) {
		this.salary = salary;
	}
	public Employee(String username, int salary,int year,int month,int day) throws ParseException {
		this.username = username;
		this.salary= salary;
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		Date date=sdf.parse(year+"-"+month+"-"+day);
		this.date=date;
	}
	public Employee() {
		// TODO Auto-generated constructor stub
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public void raiseSalary(int byPercent){
		double raise=salary*byPercent/100;
		salary+=raise;
	}
}
